sampler TextureSampler : register(s0);

int screenWidth = 800;
int screenHeight = 600;
int mozaicSize = 4;

float4 main(float2 texCoord : TEXCOORD0) : COLOR0
{
    float4 tex = tex2D(TextureSampler, float2(
        floor(screenWidth * texCoord.x / mozaicSize) * mozaicSize / screenWidth,
        floor(screenHeight * texCoord.y / mozaicSize) * mozaicSize / screenHeight));

    return tex;
}

technique
{
    pass
    {
        PixelShader = compile ps_2_0 main();
    }
}
